<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Dart : Libraries : box2d : Vector</title>
</head>

<body>

<header></header>

<h1 id="title">class <a name='Vector::Vector'>Vector</a></h1>

<section id="inheritance">

<section class="supertype">
<h2>Supertype:</h2>
<ul><li>Object</li></ul>
</section>

</section>

<section id="summary">
</section>

<section id="fields">
<h2>Fields</h2>
<dl>
<dt>
<span class="field-type"><code><code><a href='num.html#num::num'>num</a></code></code></span>
<span class="field-name"><code><a name='Vector::length'>length
</a></code></span>
</dt>
<dd>
</dd>
<dt>
<span class="field-type"><code><code><a href='num.html#num::num'>num</a></code></code></span>
<span class="field-name"><code><a name='Vector::lengthSquared'>lengthSquared
</a></code></span>
</dt>
<dd>

 Returns the length of this vector, squared.
</dd>
<dt>
<span class="field-type"><code><code><a href='num.html#num::num'>num</a></code></code></span>
<span class="field-name"><code><a name='Vector::x'>x
</a></code></span>
</dt>
<dd>
</dd>
<dt>
<span class="field-type"><code><code><a href='num.html#num::num'>num</a></code></code></span>
<span class="field-name"><code><a name='Vector::y'>y
</a></code></span>
</dt>
<dd>
</dd>
</dl>
</section>

<section id="constructors">
<h2>Constructors</h2>
<dl>
<dt>
<code><a href='Vector.html#Vector::Vector'>Vector</a>([<code><a href='num.html#num::num'>num</a></code> <a name='Vector::::x'>x</a> = 0, <code><a href='num.html#num::num'>num</a></code> <a name='Vector::::y'>y</a> = 0])</code>
</dt>
<dd>
</dd>
<dt>
<code><a href='Vector.html#Vector::Vector'>Vector</a>.<a name='Vector::copy'>copy</a>(<code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::copy::other'>other</a>)</code>
</dt>
<dd>

 Constructs a new vector with the same coordinates as the given vector.
</dd>
</dl>
</section>

<section id="methods">
<h2>Methods</h2>
<dl>
<dt>
<code><code><a href='bool.html#bool::bool'>bool</a></code> <a name='Vector::6161'>==</a>(&lt;dynamic&gt; <a name='Vector::6161::other'>other</a>)</code></dt>
<dd>

 Returns true if given object is a Vector with the same x and y values as
 this vector. Returns false otherwise.
</dd>
<dt>
<code>void <a name='Vector::absLocal'>absLocal</a>()</code></dt>
<dd>

 Set the x and y coordinates of this vector to absolute values.
</dd>
<dt>
<code><code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::addLocal'>addLocal</a>(<code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::addLocal::v'>v</a>)</code></dt>
<dd>

 Update the current vector by adding v.
</dd>
<dt>
<code>static void <a name='Vector::crossNumAndVectorToOut'>crossNumAndVectorToOut</a>(<code><a href='num.html#num::num'>num</a></code> <a name='Vector::crossNumAndVectorToOut::s'>s</a>, <code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::crossNumAndVectorToOut::a'>a</a>, <code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::crossNumAndVectorToOut::out'>out</a>)</code></dt>
<dd>

 Has the effect of swapping the x and y coordinates of the vector,
 multiplying both by the given number, and then flipping the sign of the new
 x coordinate. Returns the result through the out parameter.
</dd>
<dt>
<code>static void <a name='Vector::crossVectorAndNumToOut'>crossVectorAndNumToOut</a>(<code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::crossVectorAndNumToOut::a'>a</a>, <code><a href='num.html#num::num'>num</a></code> <a name='Vector::crossVectorAndNumToOut::s'>s</a>, <code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::crossVectorAndNumToOut::out'>out</a>)</code></dt>
<dd>

 Has the effect of swapping the x and y coordinates of the vector,
 multiplying both by the given number, and then flipping the sign of the new
 y coordinate. Returns the result through the out parameter.
</dd>
<dt>
<code>static <code><a href='num.html#num::num'>num</a></code> <a name='Vector::crossVectors'>crossVectors</a>(<code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::crossVectors::v1'>v1</a>, <code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::crossVectors::v2'>v2</a>)</code></dt>
<dd>
</dd>
<dt>
<code><code><a href='num.html#num::num'>num</a></code> <a name='Vector::distanceBetween'>distanceBetween</a>(<code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::distanceBetween::v'>v</a>)</code></dt>
<dd>

 Returns the distance between the point defined by this vector and the given
 vector.
</dd>
<dt>
<code>static <code><a href='num.html#num::num'>num</a></code> <a name='Vector::dot'>dot</a>(<code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::dot::one'>one</a>, <code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::dot::two'>two</a>)</code></dt>
<dd>

 Return the dot product of the two given vectors.
</dd>
<dt>
<code><code><a href='bool.html#bool::bool'>bool</a></code> <a name='Vector::isValid'>isValid</a>()</code></dt>
<dd>

 Returns if the values of coordinates within the MAX_INTEGER.
</dd>
<dt>
<code>static void <a name='Vector::maxToOut'>maxToOut</a>(<code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::maxToOut::a'>a</a>, <code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::maxToOut::b'>b</a>, <code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::maxToOut::out'>out</a>)</code></dt>
<dd>

 Take the maximum of each coordinate from the two given vectors and store
 the result in the given out vector.
</dd>
<dt>
<code>static void <a name='Vector::minToOut'>minToOut</a>(<code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::minToOut::a'>a</a>, <code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::minToOut::b'>b</a>, <code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::minToOut::out'>out</a>)</code></dt>
<dd>

 Take the minimum of each coordinate from the two given vectors and store
 the result in the given out vector.
</dd>
<dt>
<code><code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::mulLocal'>mulLocal</a>(<code><a href='num.html#num::num'>num</a></code> <a name='Vector::mulLocal::d'>d</a>)</code></dt>
<dd>

 Multiplies this vector by the given number.
</dd>
<dt>
<code><code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::negateLocal'>negateLocal</a>()</code></dt>
<dd>

 Flips this vector such that the +/- of each x and y are reversed.
</dd>
<dt>
<code><code><a href='num.html#num::num'>num</a></code> <a name='Vector::normalize'>normalize</a>()</code></dt>
<dd>

 Normalizes this vector and returns the length before normalization.
</dd>
<dt>
<code><code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::rotate'>rotate</a>(<code><a href='num.html#num::num'>num</a></code> <a name='Vector::rotate::angle'>angle</a>)</code></dt>
<dd>

 Returns a vector that is the result of rotating the original vector by
 angle degrees counter-clockwise.
</dd>
<dt>
<code><code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::setCoords'>setCoords</a>(<code><a href='num.html#num::num'>num</a></code> <a name='Vector::setCoords::xCoord'>xCoord</a>, <code><a href='num.html#num::num'>num</a></code> <a name='Vector::setCoords::yCoord'>yCoord</a>)</code></dt>
<dd>
</dd>
<dt>
<code><code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::setFrom'>setFrom</a>(<code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::setFrom::v'>v</a>)</code></dt>
<dd>

 Sets this vector to be a copy of the given vector.
</dd>
<dt>
<code><code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::setZero'>setZero</a>()</code></dt>
<dd>
</dd>
<dt>
<code><code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::subLocal'>subLocal</a>(<code><a href='Vector.html#Vector::Vector'>Vector</a></code> <a name='Vector::subLocal::other'>other</a>)</code></dt>
<dd>

 Subtracts the given vector from this vector.
</dd>
<dt>
<code><code><a href='String.html#String::String'>String</a></code> <a name='Vector::toString'>toString</a>()</code></dt>
<dd>

 Returns a String representation of the given vector.
</dd>
</dl>
</section>

<footer></footer>

</body></html>
